package com.feifan.consumer.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.feifan.api.annotation.LogType;
import com.feifan.api.annotation.SystemLog;
import com.feifan.api.annotation.UserLoginToken;
import com.feifan.api.model.OmsCompanyAddress;
import com.feifan.api.service.IOmsCompanyAddressService;
import com.feifan.common.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @program: FinalProject
 * @author: Xiaofan
 * @createTime: 2021-08-09 08:32
 * @description: Functions of this class is
 **/
@RestController
@Api(tags = "OmsCompanyAddressController",description = "收货地址管理")
@RequestMapping("/companyAddress")
@CrossOrigin
public class OmsCompanyAddressController {
    @Reference(
            version = "1.0.0",
            interfaceName = "com.feifan.api.service.IOmsCompanyAddressService",
            interfaceClass = IOmsCompanyAddressService.class,
            timeout = 170000
    )
    private IOmsCompanyAddressService service;

    @ApiOperation(value = "收货地址管理")
    @GetMapping(value = "/list")
    @ResponseBody
    @UserLoginToken
    @SystemLog(description = "收货地址管理",type = LogType.COMPANY_ADDRESS)
    public CommonResult<List<OmsCompanyAddress>> list(){
        return CommonResult.success(service.list());
    }

}